﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomerAdd.aspx.cs" Inherits="FastTravel.IntranetWeb.CustomerAdd" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title>Добавление клиента</title>
	 <style type="text/css">
		.con-label{
			font-weight:bold;
		}
	</style>
</head>
<body>
	<form id="formCustomerAdd" runat="server">
	<ext:ResourceManager ID="resourceManager" runat="server" Theme="Gray"/>
	
		<!-- data storage -->
		<ext:Store ID="storeMarritialStatus" runat="server">
			  <Reader>
				<ext:JsonReader IDProperty="Value">
					<Fields>
						<ext:RecordField Name="Text" />
						<ext:RecordField Name="Value" />
					</Fields>
				</ext:JsonReader>
			</Reader>           
		</ext:Store>

	<ext:Panel ID="pnlCustomerAdd" runat="server" Border="false" AutoWidth="true" ButtonAlign="Center" Layout="Fit">
			<Items>
				<ext:TabPanel ID="tabPnlGeneral" runat="server" AutoWidth="true" ActiveTabIndex="0">
					<Items>
						<ext:Panel ID="pnlPersonalInfo" runat="server" Title="Персональная информация" AutoHeight="true" AutoWidth="true" Padding="10" LabelWidth="75" Layout="Form">
							<Items>
								<ext:FieldSet runat="server" ID="fsName" Title="Ф.И.О.">
									<Items>
										<ext:TextField ID="txtLastName" runat="server" FieldLabel="Фамилия" AllowBlank="false" Width="400" SelectOnFocus="True" />
										<ext:TextField ID="txtFirstName" runat="server" FieldLabel="Имя" Width="400" SelectOnFocus="True"/>
										<ext:TextField ID="txtMiddleName" runat="server" FieldLabel="Отчество" Width="400" SelectOnFocus="True"/>
										<ext:DateField ID="dateBirth" runat="server" FieldLabel="Дата рождения" Width="250" SelectOnFocus="true" />
									</Items>
								</ext:FieldSet>
								<ext:FieldSet runat="server" ID="fsPhones" Title="Контактная информация">
									<Items>
										<ext:TextField ID="txtAddressLine1" runat="server" FieldLabel="Адрес 1" Width="400" SelectOnFocus="True"/>
										<ext:TextField ID="txtAddressLine2" runat="server" FieldLabel="Адрес 2" Width="400" SelectOnFocus="True"/>
										<ext:TextField ID="txtEmail" runat="server" FieldLabel="Email" 
										Width="300" SelectOnFocus="True" AllowBlank="true"/>
										<ext:NumberField ID="txtWorkPhone" FieldLabel="Рабочий" 
										runat="server" Width="300"
										MinValue="0" MaxValue="99999999999" MinLength="4" MaxLength="11" AllowBlank="true" SelectOnFocus="true" 
										NanText="{value} - это неверный номер" 
										MaxText="Максимальное значение для этого поля быть {maxValue}" 
										MinText="Минимальное значение для этого поля {minValue}" />
										<ext:NumberField ID="txtHomePhone" FieldLabel="Домашний" 
										runat="server" Width="300"
										MinValue="0" MaxValue="99999999999" MinLength="4" MaxLength="11" AllowBlank="true" SelectOnFocus="true" 
										NanText="{value} - это неверный номер" 
										MaxText="Максимальное значение для этого поля быть {maxValue}" 
										MinText="Минимальное значение для этого поля {minValue}" />
										<ext:NumberField ID="txtMobilePhone"  FieldLabel="Мобильный" 
										runat="server" Width="300"
										MinValue="0" MaxValue="99999999999" MinLength="4" MaxLength="11" AllowBlank="true" SelectOnFocus="true" 
										NanText="{value} - это неверный номер" 
										MaxText="Максимальное значение для этого поля быть {maxValue}" 
										MinText="Минимальное значение для этого поля {minValue}" />
									</Items>
								</ext:FieldSet>
								<ext:FieldSet runat="server" ID="fsAdditionalInfo" Title="Дополнительная информация">
									<Items>
										<ext:TextField ID="txtJobPlace" runat="server" FieldLabel="Место работы" Width="400" SelectOnFocus="True"/>
										<ext:TextField ID="txtProfession" runat="server" FieldLabel="Профессия" Width="400" SelectOnFocus="True"/>
										<ext:ComboBox ID="comboMarritialStatus" runat="server" FieldLabel="Семейное положение" SelectedIndex="0" StoreID="storeMarritialStatus" DisplayField="Text" ValueField="Value" Mode="Local" Width="400" />
									</Items>
								</ext:FieldSet>
							</Items>
						</ext:Panel>
						<ext:Panel ID="pnlPassport" runat="server" Title="Паспортные данные"	AutoHeight="true" Padding="10" LabelWidth="75" Layout="Form">
							<Items>
								<ext:TextField ID="txtNumber" runat="server" FieldLabel="Номер" AnchorHorizontal="100%" SelectOnFocus="True"/>
								<ext:TextField ID="txtAuthority" runat="server" FieldLabel="Кем выдан" AnchorHorizontal="100%" SelectOnFocus="True"/>
								<ext:FieldSet runat="server" ID="fsDateRange" Title="Дата действия">
									<items>
									<ext:DateField ID="dateFieldFrom" runat="server" Vtype="daterange" FieldLabel="Дата выдачи" Width="250" SelectOnFocus="True">
										<CustomConfig>
											<ext:ConfigItem Name="endDateField" Value="#{dateFieldTo}" Mode="Value" />
										</CustomConfig>                        
									</ext:DateField>

									<ext:DateField ID="dateFieldTo" runat="server" Vtype="daterange" FieldLabel="До" Width="250" SelectOnFocus="True">    
										<CustomConfig>
											<ext:ConfigItem Name="startDateField" Value="#{dateFieldFrom}" Mode="Value" />
										</CustomConfig>                                 
									</ext:DateField>
									
								</items>
								</ext:FieldSet>
							</Items>
						</ext:Panel>
						<ext:Panel ID="pnlAdditionalFile" runat="server" Title="Документы"	AutoHeight="true" Padding="10" LabelWidth="75" Layout="Form">
							<Items>
								
							</Items>
						</ext:Panel>
					</Items>
				</ext:TabPanel>
			</Items>
			<Buttons>
				<ext:Button ID="btnSave" runat="server" Text="Сохранить" CausesValidation="true" Icon="Accept">
					<DirectEvents>
						<Click OnEvent="BtnSaveClick">
							<EventMask ShowMask="true" MinDelay="250"/>
						</Click>
					</DirectEvents>	
				</ext:Button>
			</Buttons>
		</ext:Panel>
		
		<!-- confirmation added new customer -->
		<ext:Window ID="wndSaveConfirm" runat="server" Title="Подтверждение данных" Icon="Application" 
			Height="560" Width="400" BodyStyle="background-color: #fff;" Padding="5" 
			Collapsible="false" Modal="true" LoadMask="true" Hidden="true">
			<Content>
				<ext:FieldSet runat="server" ID="wndFsCustomer" Title="Информация о клиенте" Layout="form" DefaultAnchor="-10">
					<Items>
						<ext:Label ID="lblLastName" FieldLabel="Фамилия" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-"/>
						<ext:Label ID="lblFirstName" FieldLabel="Имя" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
						<ext:Label ID="lblMiddleName" FieldLabel="Отчество" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
						<ext:Label ID="lbldateBirth" FieldLabel="Дата рождения" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
						<ext:Label ID="lblAddres1" FieldLabel="Адрес 1" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
						<ext:Label ID="lblAddress2" FieldLabel="Адрес 2" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
						<ext:Label ID="lblJob" FieldLabel="Место работы" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
						<ext:Label ID="lblProfession" FieldLabel="Профессия" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
						<ext:Label ID="lblMarritalStatus" FieldLabel="Сем.положение" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
						<ext:Label ID="lblEmail" FieldLabel="Email" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
						<ext:Label ID="lblWorkPhone" FieldLabel="Раб.телефон" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
						<ext:Label ID="lblHomePhone" FieldLabel="Дом.телефон" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
						<ext:Label ID="lblMobilePhone" FieldLabel="Моб.телефон" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
					</Items>
				</ext:FieldSet>
				<ext:FieldSet runat="server" ID="wndFsPassport" Title="Паспорт" Layout="form">
					<Items>
						<ext:Label ID="lblPassportNumber" FieldLabel="Номер" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
						<ext:Label ID="lblAuthority" FieldLabel="Кем выдан" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
						<ext:Label ID="lblDateFrom" FieldLabel="Выдан" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
						<ext:Label ID="lblDateTo" FieldLabel="До" runat="server" AnchorVertical="100%" IsFormField="True" EmptyText="-" />
					</Items>
				</ext:FieldSet>
			</Content>
			<Buttons>
				<ext:Button ID="btnSaveConfirm" runat="server" Text="Сохранить" Icon="Accept">
				<DirectEvents>
					<Click OnEvent="BtnSaveConfirm">
						<EventMask ShowMask="true" MinDelay="250"/>
					</Click>
				</DirectEvents>
				</ext:Button>
				
				<ext:Button ID="btnCancelConfirm" runat="server" Text="Отменить" Icon="Cancel">
					<DirectEvents>
						<Click OnEvent="BtnCancelConfirm">
							<EventMask ShowMask="true" MinDelay="250"/>
						</Click>
					</DirectEvents>
				</ext:Button>
			</Buttons>
		</ext:Window>

	</form>
</body>
</html>
